package com.ly.user_system.exception;

public class LyException extends RuntimeException{

    private int code;
    private String message;
    private String formatStr;

    public int getCode() {
        return code;
    }

    public LyException(ExceptionEnums exEnum) {
        this.code=exEnum.getCode();
        this.message=exEnum.getMsg();
    }


    public LyException(ExceptionEnums exEnum,String formatStr) {
        this.code=exEnum.getCode();
        this.message=exEnum.getMsg();
    }

    public String getFormatStr() {
        return formatStr;
    }

    @Override
    public String getMessage() {
        return "Error "+code+": "+message;
    }
}
